// 表单字段
export const adddata = [
  {
    key: 'sickName',
    title: '患者姓名',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 30,
      placeholder: '请输入'
    }
  },
  {
    key: 'bedNum',
    title: '床号',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'admissionNumber',
    title: '住院号',
    type: 'input',
    attr: {
      // maxlength: 100,
      placeholder: '请输入'
    }
  },
  {
    key: 'sickSex',
    title: '性别',
    type: 'select',
    attr: {
      placeholder: '请选择'
    },
    options: [{
      value: 0,
      label: '男'
    }, {
      value: 1,
      label: '女'
    }]
  },
  {
    key: 'sickAge',
    title: '年龄',
    type: 'input',
    attr: {
      // maxlength: 100,
      placeholder: '请输入'
    }
  },
  {
    key: 'operationDate',
    title: '手术时间',
    type: 'time',
    attr: {
      class: 'date',
      type: 'datetime',
      placeholder: '请选择',
      defaultTime: '11:00:00'
    }
  },
  {
    key: 'operationDoctor',
    title: '手术医生',
    type: 'input',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'operationType',
    title: '手术类型',
    type: 'select',
    attr: {
      placeholder: '请选择'
    },
    options: [{
      value: '脊柱',
      label: '脊柱'
    }, {
      value: '创伤',
      label: '创伤'
    }, {
      value: '其他',
      label: '其他'
    }
    ]
  },
  {
    key: 'operationRoom',
    title: '手术室',
    type: 'input',
    attr: {
      // maxlength: 100,
      placeholder: '请输入'
    }
  },
  {
    key: 'createEnterprise',
    title: '生产企业',
    type: 'input',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'makeInvoice',
    title: '开票日期',
    type: 'time',
    attr: {
      class: 'date',
      type: 'date',
      placeholder: '请选择'
    }
  },
  {
    key: 'afterServer',
    title: '售后服务机构',
    type: 'input',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'invoiceNum',
    title: '发票号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'address',
    title: '地址',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 60,
      placeholder: '请输入'
    }
  },
  {
    key: 'connectPhone',
    title: '联系方式',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 60,
      placeholder: '请输入'
    }
  },

  {
    key: 'applianceWorker',
    title: '器械师',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 200,
      placeholder: '请输入'
    }
  }
]

// 表单验证
export const associationrules = {
  sickName: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  bedNum: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  admissionNumber: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  sickSex: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  sickAge: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationDate: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationDoctor: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationType: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationRoom: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  creatEnterprise: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  afterServe: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  address: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  connectPhone: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  applianceWorker: [
    { required: true, message: '请输入', trigger: 'change' }
  ]
}
// 退回产品表头
export const postoperativeProduct = [
  {
    type: 'selection',
    fixed: 'left'
  }, {
    width: '40',
    prop: 'placeholder',
    fixed: 'left',
    type: 'expand'
  }, {
    prop: 'deliveryProductCode',
    label: '配送商产品编码',
    minWidth: 200
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 200
  }, {
    prop: 'productType',
    label: '规格 型号',
    width: 150,
    formatter: row => `${row.specification || row.productType ? `${row.specification} ${row.productType}` : ''}`
  }, {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 150
  }, {
    prop: 'registrationNumber',
    label: '注册证号（或备案号）',
    width: 170
  },
  {
    prop: 'price',
    label: '单价',
    width: 80
  },
  {
    prop: 'unit',
    label: '计量单位',
    width: 90
  },
  {
    prop: 'purchaseNum',
    label: '采购数量',
    width: 90
  },
  {
    prop: 'storageCondition',
    label: '存储条件',
    minWidth: 120
  },
  {
    prop: 'provinceProductCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }
]
// 退回弹框产品表头
export const handlelistColumns = [
  {
    prop: 'deliveryProductCode',
    label: '配送商产品编码',
    minWidth: 200
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 200
  }, {
    prop: 'productType',
    label: '规格 型号',
    width: 150,
    formatter: row => `${row.specification || row.productType ? `${row.specification} ${row.productType}` : ''}`
  }, {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 150
  }, {
    prop: 'registrationNumber',
    label: '注册证号（或备案号）',
    width: 170
  },
  {
    prop: 'price',
    label: '单价',
    width: 90
  },
  {
    prop: 'unit',
    label: '计量单位',
    width: 90
  },
  {
    prop: 'purchaseNum',
    label: '采购数量',
    width: 90
  },
  {
    prop: 'storageCondition',
    label: '存储条件',
    minWidth: 120
  },
  {
    prop: 'provinceProductCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }
]
// 退回产品数量表头
export const handleitemColumns = [
  { minWidth: '180', prop: 'udi', label: 'UDI' },
  { minWidth: '180', prop: 'barCode', label: '主条码' },
  { minWidth: '180', prop: 'serialNumber', label: '序列号' },
  { minWidth: '180', prop: 'productBatch', label: '批号' },
  { minWidth: '180', prop: 'productDate', label: '生产日期' },
  { minWidth: '180', prop: 'expDate', label: '有效期' },
  { minWidth: '150', prop: 'num', label: '退货数量' },
  { minWidth: '100', prop: 'action', label: '操作' }
]

// tab状态
export const OPERATION_ORDER_STATUS = [
  {
    label: '待发货',
    value: 'voucherStatusNotDelivery'
  },
  {
    label: '待术后还回',
    value: 'voucherStatusReturn'
  },
  {
    label: '已完成',
    value: ''
  }
]
// 列表页-tab
export const indexTabsArr = [
  { lab: '全部', val: '' },
  { lab: '待发货', val: 2 },
  { lab: '待术后还回', val: 7 },
  { lab: '已完成', val: 4 }
]
// 订单状态
// wangjiaqi 11.25 适应性修改
export const ORDER_STATUS = {
  // 0: '全部',
  // 1: '待确认',
  2: '待发货',
  // 3: '部分发货',
  4: '已完成',
  // 4: '全部发货',
  // 5: '已完成',
  // 6: '已撤销',
  7: '待术后还回'
}

// 产品大类
export const PRODUCT_CATEGORY = {
  1: '高值',
  2: '低值',
  3: '试剂',
  4: '设备',
  5: '低值'
}
// 管理分类
export const PRODUCT_MANAGE_CATEGORY = {
  1: '一类',
  2: '二类',
  3: '三类'
}
// 注册地
export const PRODUCT_REGISTER_TYPE = {
  1: '国产',
  2: '港澳台',
  3: '进口'
}

// 查询项
export const SEARCH_FORM = [
  {
    key: 'hospitalName',
    title: '医疗机构',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'orderCode',
    title: '平台订单编号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'deliveryOrderCode',
    title: '配送商订单编号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'createdAt',
    title: '下单时间',
    type: 'time',
    fieldname: ['startTime', 'endTime'],
    attr: {
      placeholder: '请选择',
      type: 'daterange',
      'start-placeholder': '开始时间',
      'end-placeholder': '结束时间',
      'default-time': ['00:00:00', '23:59:59']
    }
  }
]
// 手术跟台需求订单列表表头
export const ORDER_COLUMNS = [
  {
    minWidth: '180',
    prop: 'orderCode',
    label: 'M平台订单编号'
  },
  {
    minWidth: '180',
    prop: 'deliveryOrderCode',
    label: '配送商端订单编号'
  },
  {
    prop: 'prodTypeCount',
    minWidth: '100',
    label: '发货品规数'
  },
  {
    prop: 'hospitalName',
    minWidth: '180',
    label: '医疗机构',
    'show-overflow-tooltip': true
  },
  {
    prop: 'orderTotalAmount',
    minWidth: '100',
    label: '发货金额'
  },
  {
    prop: 'returnCount',
    minWidth: '120',
    label: '术后退回品规数'
  },
  {
    prop: 'returnAmount',
    minWidth: '100',
    label: '术后退回金额'
  },
  {
    prop: 'orderStatus',
    minWidth: '100',
    label: '订单状态',
    formatter: row => ORDER_STATUS[row.orderStatus]
  },
  {
    prop: 'submitTime',
    width: '180',
    label: '提交时间'
  },
  {
    width: '180',
    prop: 'action',
    label: '操作',
    fixed: 'right'
  }
]
// 术后退回top信息
export const TOP_INFO = [
  {
    label: '平台订单编号',
    value: 'platOrderCode'
  },
  {
    label: '订单状态',
    value: 'orderStatus'
  },
  {
    label: '订单提交时间',
    value: 'orderCreatedAt'
  },
  {
    label: '医疗机构',
    value: 'hospitalName'
  }
]
// 术后退回form表单
export const OPERATION_FORM = [
  {
    $type: 'input',
    $id: 'sickName',
    label: '患者姓名',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'bedNumber',
    label: '床号',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'operationNumber',
    label: '住院号',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'select',
    $id: 'sex',
    label: '性别',
    $el: {
      placeholder: '请选择'
    },
    $options: [{
      label: '男',
      value: 1
    },
    {
      label: '女',
      value: 2
    }
    ],
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'change'
    }]
  },
  {
    $type: 'input',
    $id: 'sickAge',
    label: '年龄',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'date-picker',
    $id: 'operationDate',
    label: '手术时间',
    $el: {
      type: 'datetime',
      placeholder: '选择日期',
      prefixIcon: 'el-icon-date'
    },
    rules: [{
      type: 'date',
      required: true,
      message: '请选择时间',
      trigger: 'change'
    }]
  },
  {
    $type: 'input',
    $id: 'operationDoctor',
    label: '手术医生',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'select',
    $id: 'operateType',
    label: '手术类型',
    $el: {
      placeholder: '请选择'
    },
    $options: [{
      label: '脊柱 ',
      value: 'hospital1'
    },
    {
      label: '创伤',
      value: 'hospital2'
    }
    ],
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'change'
    }]
  },
  {
    $type: 'input',
    $id: 'operationRoom',
    label: '手术室',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'productCompany',
    label: '生产企业',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'date-picker',
    $id: 'invoiceDate',
    label: '开票日期',
    $el: {
      type: 'datetime',
      placeholder: '选择日期',
      prefixIcon: 'el-icon-date'
    }
  },
  {
    $type: 'input',
    $id: 'afterSaleService',
    label: '售后服务机构',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'invoiceNum',
    label: '发票号',
    $el: {
      placeholder: '请输入'
    }
  },
  {
    $type: 'input',
    $id: 'address',
    label: '地址',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'linkWay',
    label: '联系方式',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'instrumentDivision',
    label: '器械师',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'totalMoney',
    label: '总价',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  }
]
// 条码tab
export const TAB_ARR = [
  {
    lab: '短码',
    val: 1
  },
  {
    lab: '长码',
    val: 2
  }
]
// 术后退回列表表头
export const TABLE_COLUMNS = [{
  prop: 'productCode',
  label: '配送商产品编码',
  width: 200
},
{
  prop: 'productName',
  label: '配送商产品名称',
  width: 200
},
{
  prop: 'productSpec',
  label: '规格  型号',
  width: 150,
  formatter: row => `${row.productSpec || row.productType ? `${row.productSpec} ${row.productType}` : ''}`
},
{
  prop: 'factory',
  label: '生产厂家',
  minWidth: 150
},
{
  prop: 'certificateNo',
  label: '注册证号（或备案号）',
  width: 250
},
{
  prop: 'unitPrice',
  label: '单价',
  width: 150
},
{
  prop: 'udi',
  label: 'UDI',
  width: 150
}, {
  prop: 'mainUdi',
  label: '主条码',
  width: 150
},
{
  prop: 'num',
  label: '序列号',
  width: 150
},
{
  prop: 'batchNum',
  label: '批号',
  width: 150
}, {
  prop: 'producedDate',
  label: '生产日期',
  minWidth: 200
}, {
  prop: 'periodDate',
  label: '有效日期',
  minWidth: 200
},
{
  prop: 'returnNum',
  label: '发货数量',
  width: 150
},
{
  prop: 'minUnit',
  label: '计量单位',
  width: 150
},
{
  prop: 'entryNumf',
  label: '储存条件',
  width: 150
},
{
  prop: 'entryNumf',
  label: '省平台产品编码',
  width: 150
},
{
  prop: 'entryNfumf',
  label: 'M平台产品编码',
  width: 150
}, {
  prop: 'action',
  label: '操作',
  width: 150
}
]
// 发货
export const DELIVER_TOP_INFO = [{
  label: '平台订单编号',
  value: 'orderCode'
},
{
  label: '订单状态',
  value: 'orderStatus'
},
{
  label: '订单提交时间',
  value: 'createdAt'
},
{
  label: '医疗机构',
  value: 'hospitalName'
},
{
  label: '手术名称',
  value: 'operationName'
},
{
  label: '手术医生',
  value: 'operationDoctor'
},
{
  label: '手术时间',
  value: 'operationDate'
},
{
  label: '手术类型',
  value: 'operationType'
},
{
  label: '手术室',
  value: 'operationRoom'
},
{
  label: '台号',
  value: 'operationNum'
},
{
  label: '备注',
  value: 'desc'
}
]
// 详情
export const DETAIL_TOP_INFO = [{
  label: '平台订单编号',
  value: 'orderCode'
},
{
  label: '订单状态',
  value: 'orderStatus'
},
{
  label: '订单提交时间',
  value: 'createdAt'
},
{
  label: '医疗机构',
  value: 'hospitalName'
},
{
  label: '患者姓名',
  value: 'sickName'
},
{
  label: '床号',
  value: 'bedNum'
},
{
  label: '住院号',
  value: 'admissionNumber'
},
{
  label: '性别',
  value: 'sickSex'
},
{
  label: '年龄',
  value: 'sickAge'
},
{
  label: '手术时间',
  value: 'operationDate'
},
{
  label: '生产企业',
  value: 'desc'
},
{
  label: '手术医生',
  value: 'operationDoctor'
},
{
  label: '手术类型',
  value: 'desc'
},
{
  label: '售后服务机构',
  value: 'desc'
},
{
  label: '开票日期',
  value: 'desc'
},
{
  label: '发票号',
  value: 'desc'
},
{
  label: '地址',
  value: 'desc'
},
{
  label: '联系方式',
  value: 'desc'
},
{
  label: '器械师',
  value: 'desc'
}
]
// 详情列表表头
export const DETAIL_TABLE_COLUMNS = [
  {
    width: '40',
    prop: 'placeholder',
    fixed: 'left',
    type: 'expand'
  },
  {
    prop: 'cargo',
    label: '配送明细编号',
    minWidth: 150
  }, {
    prop: 'deliveryProductcCode',
    label: '配送商产品编码',
    minWidth: 150
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 150
  }, {
    prop: 'specification',
    label: '规格型号',
    minWidth: 150
  }, {
    prop: 'category',
    label: '产品大类',
    width: 100
  }, {
    prop: 'batchNumber',
    label: '批号',
    width: 150
  }, {
    prop: 'periodDate',
    label: '有效日期',
    width: 170
  }, {
    prop: 'purchaseNum',
    label: '配送单数量',
    minWidth: 160
  }, {
    prop: 'unit',
    label: '计量单位',
    width: 100
  }, {
    prop: 'storageCondition',
    label: '储存条件',
    width: 100
  }, {
    prop: 'productProductcCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }
]
// 详情列表里面得列表表头
export const DEATIL_INDISE_COLUMNS = [
  {
    label: '序号',
    type: 'index',
    width: 80
  }, {
    prop: 'udi',
    label: 'UDI',
    minWidth: 150
  }, {
    prop: 'barCode',
    label: '主条码',
    minWidth: 150
  }, {
    prop: 'productBatch',
    label: '批号',
    minWidth: 150
  }, {
    prop: 'productDate',
    label: '生产日期',
    width: 170
  }, {
    prop: 'expDate',
    label: '有效期',
    width: 170
  }, {
    prop: 'serialNumber',
    label: '序列号',
    minWidth: 150
  }, {
    prop: 'num',
    label: '数量',
    width: 170
  }, {
    prop: 'entryNumd',
    label: '条码图片',
    width: 150
  }
]

// 发货table列表表头
export const DELIVER_GOODS_COLUMNS = [
  {
    width: '40',
    prop: 'placeholder',
    fixed: 'left',
    type: 'expand'
  }, {
    prop: 'deliveryProductCode',
    label: '配送商产品编码',
    minWidth: 200
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 200
  }, {
    prop: 'productType',
    label: '规格 型号',
    width: 150,
    formatter: row => `${row.specification || row.productType ? `${row.specification} ${row.productType}` : ''}`
  }, {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 100
  }, {
    prop: 'registrationNumber',
    label: '注册证号（或备案号）',
    width: 170
  }, {
    prop: 'category',
    label: '产品大类',
    width: 100,
    formatter: row => PRODUCT_CATEGORY[row.category]

  }, {
    prop: 'purchaseNum',
    label: '订单总数量',
    width: 100
  }, {
    prop: 'sendNum',
    label: '已发货数量',
    width: 100
  }, {
    prop: 'sweepCount',
    label: '已扫码/待发货数量',
    width: 150,
    formatter: row => `${row.awaitSendNum ? `${row.sweepCount}/${row.awaitSendNum}` : row.sweepCount}`
  }, {
    prop: 'storageCondition',
    label: '存储条件',
    minWidth: 100
  }, {
    prop: 'provinceProductCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }, {
    prop: 'action',
    label: '操作',
    width: 100,
    fixed: 'right'
  }
]

// 部分详情列表中的列表
export const PART_DETAIL_COLUMNS_INSIDE = [
  {
    label: '序号',
    type: 'index',
    width: 80
  }, {
    prop: 'udi',
    label: 'UDI',
    width: 150
  }, {
    prop: 'barCode',
    label: '主条码',
    width: 150
  }, {
    prop: 'productBatch',
    label: '批号',
    width: 150
  }, {
    prop: 'productDate',
    label: '生产日期',
    width: 150
  }, {
    prop: 'expDate',
    label: '有效期',
    width: 150
  }, {
    prop: 'erialNumber',
    label: '序列号',
    width: 150
  }, {
    prop: 'num',
    label: '数量',
    width: 170
  }, {
    prop: 'entryNumd',
    label: '条码图片',
    width: 150
  }
]
